package com.jackchan.homework.sysw.entity;

import com.jackchan.homework.common.IdEntity;
import javax.persistence.*;

/**
 * Created by ch-hui on 15/12/26.
 * 记录营养配方中需要的几种原料及上限、下限值
 */
@Entity
@Table(name = "t_recipe_ref")
public class RecipeRef extends IdEntity {

    private RecipeNeeds needs;

    private Material material;

    private Float max;

    private Float min;

    @ManyToOne
    @JoinColumn(name = "needs_id", referencedColumnName = "id")
    public RecipeNeeds getNeeds() {
        return needs;
    }

    public void setNeeds(RecipeNeeds needs) {
        this.needs = needs;
    }

    @ManyToOne
    @JoinColumn(name = "material_id", referencedColumnName = "id")
    public Material getMaterial() {
        return material;
    }

    public void setMaterial(Material material) {
        this.material = material;
    }

    @Column(name = "max")
    public Float getMax() {
        return max;
    }

    public void setMax(Float max) {
        this.max = max;
    }

    @Column(name = "min")
    public Float getMin() {
        return min;
    }

    public void setMin(Float min) {
        this.min = min;
    }
}
